local xiannian = fk.CreateSkill {
  name = "klmou__xiannian",
  tags = { Skill.Compulsory, Skill.Switch },
}

Fk:loadTranslationTable {
  ["klmou__xiannian"] = "险念",
  [":klmou__xiannian"] = "锁定技，转换技，出牌阶段限两次，阳：你使用普通锦囊牌时此牌额外结算一次；阴：你使用伤害牌时此牌伤害+1。",

  ["$klmou__xiannian1"] = "一人之罪，全族难逃！",
}

xiannian:addEffect(fk.CardUsing, {
  anim_type = "switch",
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(xiannian.name) and player.phase == Player.Play
    and player:usedSkillTimes(xiannian.name, Player.HistoryPhase) < 2 and data.card then
      if player:getSwitchSkillState(xiannian.name) == fk.SwitchYang then
        return data.card:isCommonTrick()
      else
        return data.card.is_damage_card
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    if player:getSwitchSkillState(xiannian.name, true) == fk.SwitchYang then
      data.additionalEffect = (data.additionalEffect or 0) + 1
    else
      data.additionalDamage = (data.additionalDamage or 0) + 1
    end
  end,
})


return xiannian
